import time
def sortirovka(f1):
    start = time.time()
    f = open(f1)
    sp = [int(el.strip()) for el in f.readlines()]
    for i in range(len(sp)-1):
        for j in range(len(sp)-1-i):
            if sp[j] > sp[j+1]:
                sp[j], sp[j+1] = sp[j+1], sp[j]
    finish = time.time()
    t = round((finish - start) * 1000)
    f.close()
    print(f1, t, 'millesecunds')
sortirovka('m1_sorted.txt')
sortirovka('m2_reverse.txt')
sortirovka('m3_shuffle.txt')
